<ion-header>
  <ion-navbar>
    <ion-title>收文管理</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>
  <ion-list class="approval-list">
    <ion-list-header>
      <span class="approval-list-header-text">申请信息</span>
    </ion-list-header>
    <ion-item>
      <span class="bhq-title">来文单位: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.lwdw}}</span>
    </ion-item>
    <ion-item>
        <span class="bhq-title">来文号: </span>
        <span class="bhq-content">{{gzpublishfile.editRow.lwbh}}</span>
      </ion-item>
      <ion-item>
          <span class="bhq-title">收文时间: </span>
          <span class="bhq-content">{{gzpublishfile.editRow.lwsj | asDate}}</span>
      </ion-item>
    <ion-item>
      <span class="bhq-title">发文主题: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.fwzt}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">来文摘要: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.fwsm}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">拟办意见: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.nbyj}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">紧急等级: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.jjdjName}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">负责人: </span>
      <span class="bhq-content">({{gzpublishfile.editRow.fzrbmmcName}}){{gzpublishfile.editRow.zyfzrname}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">创建人: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.cjrmc}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">创建时间: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.cjsj | asDate}}</span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">部门名称: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.bmmcName}}</span>
    </ion-item>
    <ion-item style="height:auto">
      <span class="bhq-title">附件: </span>
      <span class="bhq-content bhq-nowrap">
        <div *ngFor="let item of gzpublishfile.editRow.fjlst">
        <a href="{{item.fjlj}}" >
          {{item.fjname | asLength:20}}
        </a><br/></div>
        <!--<a href="{{gzpublishfile.editRow.fjlj}}">{{gzpublishfile.editRow.fjname}}</a>-->
      </span>
    </ion-item>
    <ion-item>
      <span class="bhq-title">处理情况: </span>
      <span class="bhq-content">{{gzpublishfile.editRow.blqkName}}</span>
    </ion-item>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.process.U9!=null && gzpublishfile.editRow.bpmkey=='sfwgl_jzgb'">
    <ion-list-header>
      <span class="approval-list-header-text">传阅意见</span>
    </ion-list-header>
    
    
    <ng-template ngFor let-item [ngForOf]="gzpublishfile.editRow.gzreceivefile">  
      <ion-item *ngIf="(item.jsrzw=='管理员' || item.jsrzw=='科研科科长' || item.jsrzw=='办公室主任' || item.jsrzw=='资源科科长' || item.jsrzw=='计财科科长' 
      || item.jsrzw=='社会发展科科长' || item.jsrzw=='管护站长' || item.jsrzw=='办公室副主任' || item.jsrzw=='局领导') && gzpublishfile.editRow.zyfzrid!=item.jsrid">
        <ion-label cclass="bhq-title">{{item.jsrmc}}({{item.jsrzw}}):</ion-label>
        <ion-input class="bhq-content-right" *ngIf="user.userid==item.jsrid || user.userid=='admin'" [(ngModel)]="item.jsryj"></ion-input>
        <ion-label class="bhq-content" *ngIf="user.userid!=item.jsrid && user.userid!='admin'">{{item.jsryj}}</ion-label>
        <!-- <span class="bhq-content" *ngIf="user.userid!=item.jsrid && user.userid=='admin'">{{item.jsryj}}</span> -->
      </ion-item>
    </ng-template>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.editRow.bpmkey=='sfwgl_jzgb'">
    <ion-list-header>
      <span class="approval-list-header-text">收件人</span>
    </ion-list-header>
    <ion-item *ngFor="let item of gzpublishfile.editRow.gzreceivefile">
      <ion-label class="bhq-content">{{item.jsrmc}}({{item.jsrjgmc}})</ion-label>
    </ion-item>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.editRow.bpmkey=='sfwgl'">
    <ion-list-header>
      <span class="approval-list-header-text" id="tab2">办公室签批</span>
    </ion-list-header>
    <div *ngIf="gzpublishfile.process.usertask2!=null">
      <div *ngFor="let item of gzpublishfile.process.usertask2.history">
        <ion-item>
          <ion-label class="bhq-content">{{item.optcontent}}</ion-label>
        </ion-item>
        <ion-item class="bhq-last-child">
          <ion-label class="bhq-content">签批人:{{item.optassigneesname}}</ion-label>
          <ion-label class="bhq-content">时间:{{item.opttime | asDate}}</ion-label>
        </ion-item>
      </div>

      <ion-item class="bhq-last-child"
        *ngIf="gzpublishfile.process.usertask2.editRow!=null && gzpublishfile.proauth.bgssp  && gzpublishfile.process.usertask2.userEdit">
        <ion-label cclass="bhq-title">签批意见:</ion-label>
        <ion-textarea class="zs-answer-inn" aria-rowspan="5" [(ngModel)]="gzpublishfile.process.usertask2.editRow.optcontent">
        </ion-textarea>
      </ion-item>
    </div>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.editRow.bpmkey=='sfwgl_kszysj'">
    <ion-list-header>
      <span class="approval-list-header-text" id="tab2">科长签批</span>
    </ion-list-header>
    <div *ngIf="gzpublishfile.process.usertask2!=null">
      <div *ngFor="let item of  gzpublishfile.process.usertask2.history">
        <ion-item>
          <ion-label class="bhq-content">{{item.optcontent}}</ion-label>
        </ion-item>
        <ion-item class="bhq-last-child">
          <ion-label class="bhq-content">签批人:{{item.optassigneesname}}</ion-label>
          <ion-label class="bhq-content">时间:{{item.opttime | asDate}}</ion-label>
        </ion-item>
      </div>

      <ion-item class="bhq-last-child"
        *ngIf="gzpublishfile.process.usertask2.editRow!=null && gzpublishfile.proauth.kzsp  && gzpublishfile.process.usertask2.userEdit">
        <ion-label cclass="bhq-title">签批意见:</ion-label>
        <ion-textarea class="zs-answer-inn" aria-rowspan="5" [(ngModel)]="gzpublishfile.process.usertask2.editRow.optcontent">
        </ion-textarea>
      </ion-item>
    </div>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.editRow.bpmkey=='sfwgl' || gzpublishfile.editRow.bpmkey=='sfwgl_zrjbgb'">
    <ion-list-header>
      <span class="approval-list-header-text" id="tab2">局领导签批</span>
    </ion-list-header>
    <div *ngIf="gzpublishfile.process.usertask3!=null">
      <div *ngFor="let item of gzpublishfile.process.usertask3.history">
        <ion-item>
          <ion-label class="bhq-content">{{item.optcontent}}</ion-label>
        </ion-item>
        <ion-item class="bhq-last-child">
          <ion-label class="bhq-content">签批人: {{item.optassigneesname}}</ion-label>
          <ion-label class="bhq-content">时间:{{item.opttime | asDate}}</ion-label>
        </ion-item>
      </div>

      <ion-item class="bhq-last-child"
        *ngIf="gzpublishfile.process.usertask3.editRow!=null && gzpublishfile.proauth.jldsp  && gzpublishfile.process.usertask3.userEdit">
        <ion-label cclass="bhq-title">签批意见:</ion-label>
        <ion-textarea class="zs-answer-inn" aria-rowspan="5" [(ngModel)]="gzpublishfile.process.usertask3.editRow.optcontent">
        </ion-textarea>
      </ion-item>
    </div>
  </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.process.U9!=null && gzpublishfile.editRow.bpmkey!='sfwgl_jzgb'">
      <ion-list-header>
        <span class="approval-list-header-text">传阅意见</span>
      </ion-list-header>
      
      
      <ng-template ngFor let-item [ngForOf]="gzpublishfile.editRow.gzreceivefile">  
        <ion-item *ngIf="(item.jsrzw=='管理员' || item.jsrzw=='科研科科长' || item.jsrzw=='办公室主任' || item.jsrzw=='资源科科长' || item.jsrzw=='计财科科长' 
        || item.jsrzw=='社会发展科科长' || item.jsrzw=='管护站长' || item.jsrzw=='办公室副主任' || item.jsrzw=='局领导') && gzpublishfile.editRow.zyfzrid!=item.jsrid">
          <ion-label cclass="bhq-title">{{item.jsrmc}}({{item.jsrzw}}):</ion-label>
          <ion-input class="bhq-content-right" *ngIf="user.userid==item.jsrid || user.userid=='admin'" [(ngModel)]="item.jsryj"></ion-input>
          <ion-label class="bhq-content" *ngIf="user.userid!=item.jsrid && user.userid!='admin'">{{item.jsryj}}</ion-label>
          <!-- <span class="bhq-content" *ngIf="user.userid!=item.jsrid && user.userid=='admin'">{{item.jsryj}}</span> -->
        </ion-item>
      </ng-template>
    </ion-list>

  <ion-list class="approval-list" *ngIf="gzpublishfile.editRow.bpmkey=='sfwgl' || gzpublishfile.editRow.bpmkey=='sfwgl_zrjbgb' || gzpublishfile.editRow.bpmkey=='sfwgl_kszysj'">
     
    <ion-list-header>
      <span class="approval-list-header-text">收文员转发</span>
      <span style="float: right;padding-right: 1rem;" (click)="addUser();"> 
        <!--<ion-icon name="ios-arrow-forward-outline"></ion-icon>--> 
        <ion-icon name="md-contacts"></ion-icon>
       </span>
    </ion-list-header>

    <ion-item class="bhq-last-child"
    *ngIf="gzpublishfile.proauth.swyzf || gzpublishfile.proauth.fwsq">
    <ion-label cclass="bhq-title">办理结果:</ion-label>
    <ion-textarea class="zs-answer-inn" aria-rowspan="5"
    [(ngModel)]="gzpublishfile.editRow.bljg">
    </ion-textarea>
</ion-item>

<ion-item *ngIf="!(gzpublishfile.proauth.swyzf || gzpublishfile.proauth.fwsq)">
    <span class="bhq-title">办理结果: </span>
    <span class="bhq-content">{{gzpublishfile.editRow.bljg}}</span>
  </ion-item>

  
    <ion-item *ngFor="let item of gzpublishfile.editRow.gzreceivefile">
      <ion-label class="bhq-content">{{item.jsrmc}}({{item.jsrjgmc}})</ion-label>
    </ion-item>
  </ion-list>
</ion-content>

<ion-footer class="bhq-bpm-button">
  <div class="footer-btn" *ngIf="gzpublishfile.auth.opt_th" (click)="gzpublishfile.getBackTask(null,null);">
    <ion-icon name="arrow-dropleft-circle" style="font-size:2em;color: #5477b0;"></ion-icon>
    <p>退回</p>
  </div>
  <div class="footer-btn" *ngIf="gzpublishfile.auth.opt_bc" (click)="gzpublishfile.bpmSave(null);">
    <ion-icon name="lock" style="font-size:2em;color: #5477b0;"></ion-icon>
    <p>保存</p>
  </div>
  <div class="footer-btn" *ngIf="(gzpublishfile.process.U9!=null && flag)" (click)="gzpublishfile.update(null);">
    <ion-icon name="lock" style="font-size:2em;color: #5477b0;"></ion-icon>
    <p>保存</p>
  </div>
  <div class="footer-btn" *ngIf="gzpublishfile.auth.opt_tj" (click)="gzpublishfile.getNextTask(null,null);">
    <ion-icon name="arrow-dropright-circle" style="font-size:2em;color: #5477b0;"></ion-icon>
    <p>通过</p>
  </div>
  <!-- <div class="footer-more" (click)="goProcessPage();">...</div> -->
  <div class="footer-btn" (click)="goProcessPage();">
    <ion-icon name="keypad" style="font-size:2em;color: #5477b0;"></ion-icon>
    <p>更多</p>
</div>
</ion-footer>